package com.huawei.appgallery.netdiagnosekit.ui.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import huawei.widget.HwProgressBar;
import o.cmv.c;
import o.cmv.e;

public class NetDiagnoseItemView extends LinearLayout {
    private HwProgressBar ʻ;
    private View ˊ;
    private ImageView ˋ;
    private int ˎ = 3;
    private ImageView ˏ;
    private TextView ॱ;
    private View ॱॱ;

    public NetDiagnoseItemView(Context context) {
        super(context);
        ˏ();
    }

    public NetDiagnoseItemView(Context context, @Nullable AttributeSet attributeSet) {
        super(context, attributeSet);
        ˏ();
    }

    public NetDiagnoseItemView(Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        ˏ();
    }

    private void ˏ() {
        this.ˊ = LayoutInflater.from(getContext()).inflate(e.ˊ, this);
        this.ॱ = (TextView) this.ˊ.findViewById(c.ॱˋ);
        this.ˏ = (ImageView) this.ˊ.findViewById(c.ॱ);
        this.ˋ = (ImageView) this.ˊ.findViewById(c.ॱᐝ);
        this.ʻ = (HwProgressBar) this.ˊ.findViewById(c.ˊॱ);
        this.ॱॱ = this.ˊ.findViewById(c.ˏ);
    }

    public void ॱ() {
        this.ˊ.setVisibility(8);
    }

    public void ˎ(int i) {
        switch (i) {
            case 1:
                ˊ(1);
                this.ˎ = 1;
                return;
            case 2:
                ˊ(2);
                this.ˎ = 2;
                return;
            default:
                return;
        }
    }

    private void ˊ(int i) {
        if (1 == i) {
            this.ˏ.setVisibility(0);
            this.ˋ.setVisibility(8);
        } else {
            this.ˏ.setVisibility(8);
            this.ˋ.setVisibility(0);
        }
        this.ʻ.setVisibility(8);
    }

    public void setText(@StringRes int i) {
        this.ॱ.setText(i);
    }

    public void ˊ() {
        this.ॱॱ.setVisibility(8);
    }
}
